package practice10;

public class School {
    private String name;

    // 构造方法
    public School(String name) {
        this.name = name;
    }

    // 定义内部类 Student
    public class Student {
        private String studentName;
        private int age;

        // 构造方法
        public Student(String studentName, int age) {
            this.studentName = studentName;
            this.age = age;
        }

        // 打印学生信息
        public void printInfo() {
            System.out.println("学校: " + School.this.name + ", 学生姓名: " + this.studentName + ", 年龄: " + this.age);
        }
    }
}
